package Renderer.HTMLDrawer;
import Tree.Node;
import Renderer.HTMLRenderer;

/**
 * This class processes all Table tag Nodes.
 * @author Nathan Scully
 * @version FINAL
 */
public class Table extends Drawer
{
    /**
     * The Constuctor for this class, which calls the Drawer superclass and
     * passes the node and renderer to it.
     * @param node The Node to be passed to Drawer.
     * @param renderer The Renderer to be passed to Drawer.
     */
    public Table(Node node, HTMLRenderer renderer)
    {
        super(node, renderer);
    }

    /**
     * The overwritten draw method. Passes control to the renderer, which then
     * draws the table.
     */
    public void draw()
    {
        renderer.drawTable(node);
        node.setExplored(true);
    }

    /**
     * The overwritten postProcess method. Calls newLine() after a table has been drawn.
     */
    public void postProcess()
    {
        String token = node.getToken().toLowerCase();
        if(token.equals("table"))
        {
            newLine();
        }
    }
}
